package com.itheima.exerciseTest.method30_39.method32;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.util.Random;
import java.util.Scanner;

public class ClientDemo1 {
    public static void main(String[] args) throws IOException, InterruptedException {
        Scanner sc = new Scanner(System.in);
        Random r = new Random();
        DatagramSocket ds = new DatagramSocket();

        while (true){
            Thread.sleep(100);
            byte[] bytes = "您的余额已不足，请及时充值。".getBytes();
            InetAddress byName = InetAddress.getByName("255.255.255.255"); // 192.168.23.34

            //int port = r.nextInt(5)+10000;
            int port = 10000;
            DatagramPacket dp = new DatagramPacket(bytes,bytes.length,byName,port);
            ds.send(dp);

        }
    }
}
